home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 July / CD 3 / redhat-6.2.iso / RedHat / instimage / usr / lib / anaconda / iw / dependencies.py < prev    next >
Encoding:
Python Source  |  2000-03-08  |  1.3 KB  |  50 lines

  1. from iw import *
  2. from gtk import *
  3. from translate import _
  4.  
  5. class UnresolvedDependenciesWindow (InstallWindow):
  6.  
  7.     def __init__ (self, ics):
  8.     InstallWindow.__init__ (self, ics)
  9.         ics.setTitle (_("Unresolved Dependencies"))
  10.         ics.setNextEnabled (1)
  11.         ics.readHTML ("depend")
  12.         self.dependCB = None
  13.  
  14.     def getNext (self):
  15.         if self.dependCB and self.dependCB.get_active ():
  16.             self.todo.selectDeps (self.deps)
  17.         return None
  18.     
  19.     def getScreen (self):
  20.     threads_leave ()
  21.         self.deps = self.todo.verifyDeps ()
  22.     threads_enter ()
  23.         if not self.deps:
  24.             return None
  25.  
  26.         sw = GtkScrolledWindow ()
  27.         sw.set_border_width (5)
  28.         sw.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC)
  29.  
  30.         list = GtkCList (2, (_("Package"), _("Requirement")))
  31.         list.freeze ()
  32.         for (name, suggest) in self.deps:
  33.             list.append ((name, suggest))
  34.     list.columns_autosize ()
  35.         list.thaw ()
  36.         sw.add (list)
  37.  
  38.         self.dependCB = GtkCheckButton (_("Install packages to satisfy dependencies"))
  39.         self.dependCB.set_active (TRUE)
  40.         align = GtkAlignment (0.5, 0.5)
  41.         align.add (self.dependCB)
  42.  
  43.         box = GtkVBox (FALSE, 5)
  44.         box.pack_start (sw, TRUE)
  45.         box.pack_start (align, FALSE)
  46.  
  47.         return box
  48.  
  49.  
  50.